var app = getApp()
var utils = require('../../../utils/utils.js')
Page( {
  data: {
    order: null,
    cartProduct: null,
    addressInfo:null,
  },
  //订单详情
  onLoad: function(options) {
    wx.showLoading({
      title: '加载中...',
    })
    var that = this
    var params = {"orderId":options.id};
    wx.request({
      url: utils.sysConst.orderDetailPath,
      method: 'POST',
      header: {
        "Content-Type": "application/x-www-form-urlencoded",'appVersion':utils.appVersion,'signValue':utils.getSignValue(params)
      },
      data: params ,
      dataType: "json",
      success: function(res) {
        if (res.data.code == 1){
          that.setData({
            order: res.data.data,
            cartProduct: res.data.data.orderDetailVoList,
            addressInfo:res.data.data.orderAddressVo,
          })
        }else{
          that.setData({
            cartProduct :null,
            addressInfo:null,
          })
        }
      }
    })
    wx.hideLoading();
    //=== end ===
  }
  // === end ===
})
